A multi-leaf collimator (MLC) may be used in shaping a radiation beam used in radiosurgery and radiotherapy (RT). Usually, a multi-leaf collimator is driven by one or more motors. The operation of the motors may be affected by the magnetic field generated by a device nearby. Also, current generated by the motors may tangle the magnetic field and thus affect the device nearby. There is a need to overcome such interferences.